<?php
/**
 * Abstract class to create view renderers from.
 */
abstract class View_Renderer {
    /**
     * The text to render.
     * @var string
     */
    protected $text;
    /**
     * The parameters to use in the template.
     * @var array
     */
    protected $params = array();

    /**
     * Set the parameters.
     * @param array $params
     * @throws View_Exception
     */
    public function setParams($params) {
        if(is_array($params)) {
            $this->params = $params;
        } else {
            throw new View_Exception('$params must be an array.');
        }
    }

    /**
     * Render the text.
     * @param string $text
     */
    public function render($text) {
        $this->text = $text;
    }
}
?>